package FuncFileUp

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"strconv"
	"time"
)

func GetFileIndex(context *gin.Context) {
	context.HTML(200, "demo01/index.html", nil)
}

func Upfile(context *gin.Context) {
	//获取文件
	file, _ := context.FormFile("file")
	fmt.Println(file.Filename)
	//获取时间戳
	time_int := time.Now().Unix()
	//转换为字符串
	time_Str := strconv.FormatInt(time_int, 10)
	//将文件保存到本地
	context.SaveUploadedFile(file, "D://"+time_Str+file.Filename)

}
